#include "utils.h"

int randomSeed = 0;

int poison(float rate) {
	float l = pow(rate, -M_E);
	float p = 1;
	int k = 0;
	float u;

	do {
		k += 1;
		RANDOM_SEED;
		u = RANDOM_NUM;
		p = p * u;
	}while (p > l);

	return k-1;
}
